package com.teamone.mobilewatch.xml;

import org.xmlpull.v1.XmlPullParserException;
/**
 * Factory to create XMLProcessor instances depending on the processor type
 *
 */
public class XmlProccessorFactory {
	/**
	 * Creates a processor to parse specific XML response string    
	 * @param requestType
	 * @return XMLProceccor instance
	 * @throws XmlPullParserException 
	 */
	public static XmlProcessor getProcessor(ProcessorType type) throws XmlPullParserException {
		switch (type) {
		case PATIENT:
			return PatientXmlProcessorImpl.getInstance();
		case PATIENT_READINGS:
			return PatientReadingsXmlProcessorImpl.getInstance();
		case SIMULATOR_STATE:
			return SingleTagXmlProcessorImpl.getInstance();
		case SIMPLE_RESPONSE:
			return SingleTagXmlProcessorImpl.getInstance();
		default:
			return null;
		}
	}
}

